#!/bin/bash
githome=/data/server/gitcode/
projectname=jsite
cd $githome/
rm -rf *
git clone https://gitee.com/sectlove/jsite.git
rm -rf  $githome/target/*
cd $githome/$projectname
mvn clean
mvn clean install
jar -xvf $githome/$projectname/target/$projectname.war
mkdir -p /data/server/tomcat/webapps/ROOT
rm -rf /data/server/tomcat/webapps/ROOT/WEB-INF
rm -rf /data/server/tomcat/webapps/ROOT/static
rm -rf /data/server/tomcat/webapps/ROOT/pc
cp -r $githome/$projectname/target/$projectname/*  /data/server/tomcat/webapps/ROOT/
echo ' $githome/$projectname/target/$projectname/*'
sh /data/server/tomcat/bin/catalina.sh stop
sleep 10
sh /data/server/tomcat/bin/catalina.sh start
echo '重启成功 ......'

